package com.hanggold.jfinal.controller;

import com.hanggold.jfinal.service.UserService;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.core.Path;
import lombok.extern.slf4j.Slf4j;

@Path("hello")
@Slf4j
public class HelloController extends Controller {

    @Inject
    private UserService userService;
    
    public void index(){
        log.info("my first jfinal program");
        renderText("helloworld");
    }
    public void hi(){
        renderText("hi");
    }

//    @ActionKey("login")
    public void login(){
        renderText("login");
    }

    public void html(){
        render("index.html");
    }
    
    public void demo(){
        render("demo.html");
    }
    public void user(){
        userService.say("jfinal");
        renderText("jfinal inject first");
    }
}
